package cz.muni.fi.pa165.sportclubmanager.service;

import cz.muni.fi.pa165.sportclubmanager.dto.AgeCategoryDTO;
import java.util.List;
import javax.jws.WebService;

/**
 * Service layer interface that deals with creating/updating/removing/listing
 * AgeCategoryDTO objects. Every AgeCategory (and AgeCategoryDTO too) is bounded
 * from up and down by age and this age interval must remain unique in database
 * and must not overlap with another AgeCategory's interval.
 *
 * @author Matus Duchon (xduchon2@fi.muni.cz, 418127)
 */
@WebService
public interface AgeCategoryService {

    /**
     * Creates new age category.
     *
     * @param ac age category to create
     * @throws IllegalArgumentException when this age category age interval
     * overlaps some existing age category's interval
     */
    public void create(AgeCategoryDTO ac);

    /**
     * Updates age category specified by field id with other fields' values.
     *
     * @param ac age category to update, id field should be set
     * @throws IllegalArgumentException when this age category age interval
     * overlaps some existing age category's interval
     */
    public void update(AgeCategoryDTO ac);

    /**
     * Removes age category.
     *
     * @param ac AgeCategory to remove.
     */
    public void remove(AgeCategoryDTO ac);

    /**
     * Return age category with given id.
     *
     * @param id id of age category
     * @return AgeCategoryDTO for given id
     */
    public AgeCategoryDTO find(Long id);

    /**
     * Returns all age categories.
     *
     * @return list of all age categories
     */
    public List<AgeCategoryDTO> findAll();
}